package org.reach.springframework.factory.support;

import org.reach.springframework.factory.config.BeanDefinition;

/**
 * @author 尹志远
 * @desc
 * @Date 2024/2/4 13:32
 */
public abstract class AbstractAutowireCapableBeanFactory extends AbstractSingletonBeanFactory{

    @Override
    protected Object createBean(String beanName, BeanDefinition beanDefinition) {
        Object bean;
        try {
            bean = beanDefinition.getBeanClass().newInstance();
        } catch (InstantiationException | IllegalAccessException e) {

            return null;
        }

        addSingleton(beanName, bean);
        return bean;
    }

}

